package zilvic.gui.world;

import java.awt.Graphics;
import zilvic.game.Game;
import zilvic.game.KeyInputHandler;
import zilvic.gui.GUI;
import zilvic.gui.Screen;

/**
 *
 * @author Duncan
 */
public class WorldScreen extends Screen  {
    @Override
    public WorldScreen step(long delta) {
        if (Game.getInputHandler().isKeyDown(KeyInputHandler.KEY_MENU)) {
            GUI.getGUI().setCurrentScreen(GUI.SCREEN_GAME_MENU);
            Game.getInputHandler().setKeyDown(KeyInputHandler.KEY_MENU, false);
        } else {
            Game.getInstance().gameLoop(delta);
        }
        return this;
    }

    @Override
    public WorldScreen draw(Graphics g) {
        Game.getInstance().gameDraw(g);
        return this;
    }
}